<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>OA协同办公系统</title>
		<link type="text/css" rel="stylesheet" href="css/table.css"/>
		<style type="text/css">
body,td,th {
	font-family: "宋体";
	font-size: 12px;
}
</style>
<link type="text/css" rel="stylesheet" href="css/table.css">
		<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
		<script type="text/javascript">
	function selectRole(){
		var id="";
		var name="";
		var roles=$("input[type=\"checkbox\"]");
		for(var i=0;i<roles.length;i++){
			if(roles[i].checked){
				if(id==""){
					id+=roles[i].value;
					name+=roles[i].name;
				}else{
					id+=","+roles[i].value;
					name+=","+roles[i].name;
				}
			}
		}
		window.opener.addRole(id,name);
		window.close();
	}
</script>
	</head>

	<body>
		<table align="center">
			<tr>
				<td>
					<div class="roladiv">
						<h1 class="rolah1">
							角色管理
						</h1>
						<ul style="list-style: none">
							<c:forEach items="${roleList}" var="role">
								<li>
									<c:if test="${role.type=='1'}">
									<input type="checkbox" name="${role.name}" value="${role.id}" />
									</c:if>
									<c:if test="${role.type!='1'}">
									<input type="checkbox" disabled="disabled" name="${role.name}" value="${role.id}" />
									</c:if>
									&nbsp;${role.name}
								</li>
							</c:forEach>
						</ul>
					</div>
				</td>
			</tr>
			<tr>
				<td align="center">
					<input type="button" onclick="selectRole()" class="button_04" value="添加" />
				</td>
			</tr>
		</table>
	</body>
</html>
